package cn.maihe.elg.operation.supports.electronicseal.kt.cloudsign.service;

import cn.maihe.elg.operation.supports.electronicseal.kt.KtConfig;
import cn.maihe.elg.operation.supports.electronicseal.kt.cloudsign.BaseKtCloudSignService;
import cn.maihe.elg.operation.supports.electronicseal.kt.cloudsign.dto.PdfAutoStampReqDTO;
import cn.maihe.elg.operation.supports.electronicseal.kt.cloudsign.enums.CloudSignInterfaceEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Description 调用该接口进行pdf签章
 * @Author WJH
 * @Date 2022/09/19
 */
@Service
@Slf4j
public class PdfAutoStampService extends BaseKtCloudSignService<PdfAutoStampReqDTO, Void> {
    public PdfAutoStampService(KtConfig ktConfig) {
        super(ktConfig);
    }

    @Override
    protected CloudSignInterfaceEnum serviceName() {
        return CloudSignInterfaceEnum.stamp;
    }


    /**
     * @param type 用户类型	String	0	Y	1企业，2个人
     */
    public boolean pdfAutoStamp(String acceptOrderNo, String sid,String type, String creditCode, String authToken) {
        PdfAutoStampReqDTO reqDTO = new PdfAutoStampReqDTO();
        reqDTO.setSid(sid);
        reqDTO.setType(type);
        reqDTO.setUser(creditCode);
        reqDTO.setAuthToken(authToken);

         this.doService(acceptOrderNo, reqDTO);

        return true;
    }

}
